package chapter1.No1_2_使用多线程.c实例变量于线程安全;

/**
 * *：不同享数据
 *
 * @author liujian
 * @version 2016/11/8 0008
 */
public class MyThread extends Thread {
    public MyThread(String name) {
        super(name);
    }

    int count = 5;
    @Override
    public void run() {
        while(count > 0) {
            System.out.println(Thread.currentThread().getName()+"="+count--);
        }
    }

    public static void main(String[] args) {
        MyThread my1 = new MyThread("A");
        my1.start();
        MyThread my2 = new MyThread("B");
        my2.start();
        MyThread my3 = new MyThread("C");
        my3.start();
    }
}
